class TestOceanBaseBackup(unittest.TestCase):
    def test_full_backup(self):
        """测试全量备份"""
        service = OceanBaseBackupService(config)
        result = service.execute_backup("FULL")
        self.assertTrue(os.path.exists(result.backup_path))
        self.assertGreater(result.data_size, 0)
        
    def test_incremental_backup(self):
        """测试增量备份"""
        # 先执行全量备份
        full_backup = service.execute_backup("FULL")
        
        # 执行增量备份
        incr_backup = service.execute_backup("INCREMENTAL")
        self.assertLess(incr_backup.data_size, full_backup.data_size)
        
    def test_point_in_time_recovery(self):
        """测试时间点恢复"""
        # 创建测试数据
        test_data = generate_test_data()
        
        # 执行备份
        backup_id = service.backup()
        
        # 修改数据
        modify_data(test_data)
        
        # 执行恢复
        restorer.restore(backup_id, point_in_time="2023-01-01 12:00:00")
        
        # 验证数据
        self.assertEqual(get_current_data(), test_data)